<!-- template放HTML script放JS style放CSS -->
<!-- 注意:script标签上必须有setup属性 -->

<template>
  <h1>文本指令</h1>
  <h1>第一个Vue组件Component</h1>
  <p>{{info}}</p>
  <h4>{{info}}</h4>
  {{info+'下午好'}}
  <button @click="f()">按钮</button>
  <p>{{count}}</p>
  <button @click="c()">按钮</button>
  <hr>
  <p>{{a}}</p>
  <p v-text="a"></p>
  <p v-html="a"></p>
</template>

<script setup>
import {ref} from "vue";
//定义响应式变量
const info = ref("我是info")
//定义箭头函数
const f = () => {
  console.log(info.value);
  info.value = "我是新值"
}
const count = ref(0);
const c = () => {
  count.value++;
}

const a = ref('111111')
</script>

<style scoped>

</style>